/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.proyectoGonseca.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "parciales", catalog = "gonseca", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Parciales.findAll", query = "SELECT c FROM Parciales c"),
    @NamedQuery(name = "Parciales.findById_parciales", query = "SELECT c FROM Parciales c WHERE c.id_parciales = :id_parciales"),
    @NamedQuery(name = "Parciales.findByCorte", query = "SELECT c FROM Parciales c WHERE c.corte = :corte"),
    @NamedQuery(name = "Parciales.findByPeriodo", query = "SELECT c FROM Parciales c WHERE c.periodo = :periodo"),
    @NamedQuery(name = "Parciales.findByResuelto", query = "SELECT c FROM Parciales c WHERE c.resuelto = :resuelto"),
    @NamedQuery(name = "Parciales.findByNota", query = "SELECT c FROM Parciales c WHERE c.nota = :nota")})
    
public class Parciales implements Serializable {
    private static final long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_parciales")
    private Integer id_parciales;
    @Basic(optional = false)
    @NotNull
    @Column(name = "corte")
    private Integer corte;
    @Basic(optional = false)
    @NotNull
    @Column(name = "periodo")
    @Size(min = 1, max = 150)
    private String periodo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "resuelto")
    private Boolean resuelto;
    @Basic(optional = true)
    @Column(name = "nota")
    private Double nota ;

    @ManyToOne(optional = false)
    private Materias materias;
    
    @ManyToOne(optional = false)
    private Usuarios usuarios;
    
    public Parciales() {
    }

    public Parciales(Integer id_parciales, Integer corte, String periodo, Boolean resuelto, Double nota) {
        this.id_parciales = id_parciales;
        this.corte = corte;
        this.periodo = periodo;
        this.resuelto = resuelto;
        this.nota = nota;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id_parciales != null ? id_parciales.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Parciales)) {
            return false;
        }
        Parciales other = (Parciales) object;
        if ((this.id_parciales == null && other.id_parciales != null) || (this.id_parciales != null && !this.id_parciales.equals(other.id_parciales))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.proyectoGonseca.entities.Parciales[ id_parciales=" + id_parciales + " ]";
    }

    public Integer getId_parciales() {
        return id_parciales;
    }

    public void setId_parciales(Integer id_parciales) {
        this.id_parciales = id_parciales;
    }

    public Integer getCorte() {
        return corte;
    }

    public void setCorte(Integer corte) {
        this.corte = corte;
    }

    public String getPeriodo() {
        return periodo;
    }

    public void setPeriodo(String periodo) {
        this.periodo = periodo;
    }

    public Boolean isResuelto() {
        return resuelto;
    }

    public void setResuelto(Boolean resuelto) {
        this.resuelto = resuelto;
    }

    public Double getNota() {
        return nota;
    }

    public void setNota(Double nota) {
        this.nota = nota;
    }
    
}